import {mRequest} from '@/utils/request'
import {isEmail} from '@/utils/validate'
import {isMobile} from '@/utils/validate'

export default {
  data() {
    const validatePassword = (rule, value, callback) => {
      if (!this.dataForm.id && !/\S/.test(value)) {
        return callback(new Error('密码不能为空'))
      }
      return callback()
    }
    const validateConfirmPassword = (rule, value, callback) => {
      if (!this.dataForm.id && !/\S/.test(value)) {
        return callback(new Error('确认密码不能为空'))
      }
      if (this.dataForm.password !== value) {
        return callback(new Error('确认密码与密码输入不一致'))
      }
      return callback()
    }
    const validateEmail = (rule, value, callback) => {
      if (!isEmail(value)) {
        return callback(new Error('邮箱格式错误'))
      }
      return callback()
    }
    const validateMobile = (rule, value, callback) => {
      if (!isMobile(value)) {
        return callback(new Error('手机号格式错误'))
      }
      return callback()
    }
    return {
      dataForm: {},
      dataRuleList: {
        modelCategoryName: [
          {required: true, message: '模具类别名称不能为空', trigger: 'blur'}
        ],
        parentId:[
          {required: true, message: '父节点不能为空', trigger: 'blur'}
        ],
        username: [
          {required: true, message: '用户名不能为空', trigger: 'blur'}
        ],
        password: [
          {validator: validatePassword, trigger: 'blur'}
        ],
        confirmPassword: [
          {validator: validateConfirmPassword, trigger: 'blur'}
        ],
        email: [
          {required: true, message: '邮箱不能为空', trigger: 'blur'},
          {validator: validateEmail, trigger: 'blur'}
        ],
        mobile: [
          {required: true, message: '手机号不能为空', trigger: 'blur'},
          {validator: validateMobile, trigger: 'blur'}
        ],
        shortName:  [
          {required: true, message: '简称不能为空', trigger: 'blur'}
        ],
        deviceName: [
          {required: true, message: '光瓶生产厂商不能为空', trigger: 'blur'}
        ],
        factoryId: [
          {required: true, message: '纸箱厂不能为空', trigger: 'blur'}
        ],
        boxInfoId: [
          {required: true, message: '纸箱ID不能为空', trigger: 'blur'}
        ],
        status: [
          {required: true, message: '状态不能为空', trigger: 'blur'}
        ],
        factoryName: [
          {required: true, message: '厂家名不能为空', trigger: 'blur'}
        ],
        principal: [
          {required: true, message: '负责人不能为空', trigger: 'blur'}
        ],
        mobilePhoneNumber: [
          {required: true, message: '手机号不能为空', trigger: 'blur'}
        ],
        telephoneNumber: [
          {required: true, message: '电话不能为空', trigger: 'blur'}
        ],
        remark: [
          {required: true, message: '备注不能为空', trigger: 'blur'}
        ],
        boxNo: [
          {required: true, message: '纸箱编号不能为空', trigger: 'blur'}
        ],
        bodySize: [
          {required: true, message: '箱子尺寸不能为空', trigger: 'blur'}
        ],
        spacerNumber: [
          {required: true, message: '配套垫片不能为空', trigger: 'blur'}
        ],
        parryNumber: [
          {required: true, message: '配套格挡不能为空', trigger: 'blur'}
        ],
        pieceNumber: [
          {required: true, message: '每箱只数不能为空', trigger: 'blur'}
        ],
        customer: [
          {required: true, message: '客户不能为空', trigger: 'blur'}
        ],
        boxNumber: [
          {required: true, message: '数量不能为空', trigger: 'blur'}
        ],
        classesName: [
          {required: true, message: '班别名不能为空', trigger: 'blur'}
        ],
        clientName: [
          {required: true, message: '客户名称不能为空', trigger: 'blur'}
        ],
        deviceId: [
          {required: true, message: '机器设备名称不能为空', trigger: 'blur'}
        ],
        classId: [
          {required: true, message: '班别不能为空', trigger: 'blur'}
        ],
        userId: [
          {required: true, message: '员工编号不能为空', trigger: 'blur'}
        ],
        productId: [
          {required: true, message: '产品名称不能为空', trigger: 'blur'}
        ],
        boxPieceNumber: [
          {required: true, message: '每箱只数不能为空', trigger: 'blur'}
        ],
        productNumber: [
          {required: true, message: '入库总只数不能为空', trigger: 'blur'}
        ],
        productWeight: [
          {required: true, message: '产品单只重量不能为空', trigger: 'blur'}
        ],
        countWeight: [
          {required: true, message: '总重量不能为空', trigger: 'blur'}
        ],
        dividingWeight: [
          {required: true, message: '分计不能为空', trigger: 'blur'}
        ],
        dripLiquid: [
          {required: true, message: '滴料不能为空', trigger: 'blur'}
        ],
        successRate: [
          {required: true, message: '成品率不能为空', trigger: 'blur'}
        ],
        deepCategoryName: [
          {required: true, message: '深加工类别名不能为空', trigger: 'blur'}
        ],
        ingredientInfoId: [
          {required: true, message: '原料id不能为空', trigger: 'blur'}
        ],
        weight: [
          {required: true, message: '吨数不能为空', trigger: 'blur'}
        ],
        price: [
          {required: true, message: '价格不能为空', trigger: 'blur'}
        ],
        tickerNumber: [
          {required: true, message: '票号不能为空', trigger: 'blur'}
        ],
        dayTime: [
          {required: true, message: '日期不能为空', trigger: 'blur'}
        ],
        plateNumber: [
          {required: true, message: '车牌号不能为空', trigger: 'blur'}
        ],
        freight: [
          {required: true, message: '运费不能为空', trigger: 'blur'}
        ],
        imageUrl: [
          {required: true, message: '图片不能为空', trigger: 'blur'}
        ],
        isPay: [
          {required: true, message: '付款方式不能为空', trigger: 'blur'}
        ],
        ingredientCategoryName: [
          {required: true, message: '辅料类别名称不能为空', trigger: 'blur'}
        ],
        supplierId: [
          {required: true, message: '供应商id不能为空', trigger: 'blur'}
        ],
        ingredientName: [
          {required: true, message: '原料名称不能为空', trigger: 'blur'}
        ],
        warningNumber: [
          {required: true, message: '预警值不能为空', trigger: 'blur'}
        ],
        ingredientCategoryId: [
          {required: true, message: '类别不能为空', trigger: 'blur'}
        ],
        tunnage: [
          {required: true, message: '吨数不能为空', trigger: 'blur'}
        ],
        modelInfoId: [
          {required: true, message: '模具信息id不能为空', trigger: 'blur'}
        ],
        handlingPeople: [
          {required: true, message: '模具经手人不能为空', trigger: 'blur'}
        ],
        modelNo: [
          {required: true, message: '模具编号不能为空', trigger: 'blur'}
        ],
        successMo: [
          {required: true, message: '成模不能为空', trigger: 'blur'}
        ],
        primaryMo: [
          {required: true, message: '初模不能为空', trigger: 'blur'}
        ],
        menTou: [
          {required: true, message: '闷头不能为空', trigger: 'blur'}
        ],
        louDou: [
          {required: true, message: '漏斗不能为空', trigger: 'blur'}
        ],
        kouZi: [
          {required: true, message: '口子不能为空', trigger: 'blur'}
        ],
        xinZi: [
          {required: true, message: '芯子不能为空', trigger: 'blur'}
        ],
        qiTou: [
          {required: true, message: '气头不能为空', trigger: 'blur'}
        ],
        jiaZi: [
          {required: true, message: '夹子不能为空', trigger: 'blur'}
        ],
        lengQue: [
          {required: true, message: '冷却不能为空', trigger: 'blur'}
        ],
        modelShelfId: [
          {required: true, message: '架号不能为空', trigger: 'blur'}
        ],
        modelType: [
          {required: true, message: '模具状态不能为空', trigger: 'blur'}
        ],
        recipientPeople: [
          {required: true, message: '提货人不能为空', trigger: 'blur'}
        ],
        deliveryMethod: [
          {required: true, message: '发货方式不能为空', trigger: 'blur'}
        ],
        warehouseId: [
          {required: true, message: '仓库号不能为空', trigger: 'blur'}
        ],
        shelfNo: [
          {required: true, message: '架号不能为空', trigger: 'blur'}
        ],
        levelNo: [
          {required: true, message: '层号不能为空', trigger: 'blur'}
        ],
        isEmpty: [
          {required: true, message: '是否有货不能为空', trigger: 'blur'}
        ],
        modelId: [
          {required: true, message: '模具id不能为空', trigger: 'blur'}
        ],
        modelMsgId: [
          {required: true, message: '模具消息id不能为空', trigger: 'blur'}
        ],
        hasRead: [
          {required: true, message: '是否已读不能为空', trigger: 'blur'}
        ],
        warehouseName: [
          {required: true, message: '仓库名称不能为空', trigger: 'blur'}
        ],
        orderNo: [
          {required: true, message: '订单编号不能为空', trigger: 'blur'}
        ],
        orderTime: [
          {required: true, message: '订单时间不能为空', trigger: 'blur'}
        ],
        clientId: [
          {required: true, message: '客户id不能为空', trigger: 'blur'}
        ],
        productPrice: [
          {required: true, message: '单价不能为空', trigger: 'blur'}
        ],
        deliveryTime: [
          {required: true, message: '交货时间不能为空', trigger: 'blur'}
        ],
        accountReceivable: [
          {required: true, message: '应收账款不能为空', trigger: 'blur'}
        ],
        payMoney: [
          {required: true, message: '付款金额不能为空', trigger: 'blur'}
        ],
        payWay: [
          {required: true, message: '付款方式不能为空', trigger: 'blur'}
        ],
        payNo: [
          {required: true, message: '付款单号不能为空', trigger: 'blur'}
        ],
        payTime: [
          {required: true, message: '付款时间不能为空', trigger: 'blur'}
        ],
        payStatus: [
          {required: true, message: '付款状态不能为空', trigger: 'blur'}
        ],
        orderProductNumber: [
          {required: true, message: '订单数量不能为空', trigger: 'blur'}
        ],
        lossNumber: [
          {required: true, message: '订单数量不能为空', trigger: 'blur'}
        ],
        boxSupplyWay: [
          {required: true, message: '纸箱供应方式不能为空', trigger: 'blur'}
        ],
        trayNumber: [
          {required: true, message: '托盘数量不能为空', trigger: 'blur'}
        ],
        deepStatus: [
          {required: true, message: '是否深加工不能为空', trigger: 'blur'}
        ],
        deepType: [
          {required: true, message: '深加工方式（数组）不能为空', trigger: 'blur'}
        ],
        customerProductStyle: [
          {required: true, message: '客户样品 有 无不能为空', trigger: 'blur'}
        ],
        bottleCapSuit: [
          {required: true, message: '瓶盖套装 有 无不能为空', trigger: 'blur'}
        ],
        packRequire: [
          {required: true, message: '包装要求不能为空', trigger: 'blur'}
        ],
        customerRequire: [
          {required: true, message: '客户需求不能为空', trigger: 'blur'}
        ],
        bottleInDiameter: [
          {required: true, message: '瓶口内径不能为空', trigger: 'blur'}
        ],
        headNeckHeight: [
          {required: true, message: '头经高度不能为空', trigger: 'blur'}
        ],
        bottleHeight: [
          {required: true, message: '瓶高不能为空', trigger: 'blur'}
        ],
        bottleOutDiameter: [
          {required: true, message: '瓶口外径不能为空', trigger: 'blur'}
        ],
        orderDetailId: [
          {required: true, message: '订单id不能为空', trigger: 'blur'}
        ],
        sysUserId: [
          {required: true, message: '人员id不能为空', trigger: 'blur'}
        ],
        proofingName: [
          {required: true, message: '打样名称不能为空', trigger: 'blur'}
        ],
        number: [
          {required: true, message: '数量不能为空', trigger: 'blur'}
        ],
        calibrator: [
          {required: true, message: '口径不能为空', trigger: 'blur'}
        ],
        volume: [
          {required: true, message: '容量不能为空', trigger: 'blur'}
        ],
        proofingTime: [
          {required: true, message: '打样时间不能为空', trigger: 'blur'}
        ],
        localProduct: [
          {required: true, message: '在场生产不能为空', trigger: 'blur'}
        ],
        returnNumber: [
          {required: true, message: '退货数量不能为空', trigger: 'blur'}
        ],
        returnTime: [
          {required: true, message: '退货时间不能为空', trigger: 'blur'}
        ],
        needBoxNumber: [
          {required: true, message: '纸箱数量不能为空', trigger: 'blur'}
        ],
        returnReason: [
          {required: true, message: '退货原因不能为空', trigger: 'blur'}
        ],
        orderMsgId: [
          {required: true, message: '订单消息id不能为空', trigger: 'blur'}
        ],
        partInfoId: [
          {required: true, message: '配件信息id不能为空', trigger: 'blur'}
        ],
        partNumber: [
          {required: true, message: '配件数量不能为空', trigger: 'blur'}
        ],
        personName: [
          {required: true, message: '人员不能为空', trigger: 'blur'}
        ],
        partCategoryName: [
          {required: true, message: '配件类别名称不能为空', trigger: 'blur'}
        ],
        partName: [
          {required: true, message: '配件名称不能为空', trigger: 'blur'}
        ],
        partCategoryId: [
          {required: true, message: '类型不能为空', trigger: 'blur'}
        ],
        productCategoryName: [
          {required: true, message: '产品类别名称不能为空', trigger: 'blur'}
        ],
        productNo: [
          {required: true, message: '产品编号不能为空', trigger: 'blur'}
        ],
        clientProductNo: [
          {required: true, message: '客户产品编号不能为空', trigger: 'blur'}
        ],
        boxId: [
          {required: true, message: '纸箱编号不能为空', trigger: 'blur'}
        ],
        productVolume: [
          {required: true, message: '产品容量不能为空', trigger: 'blur'}
        ],
        productImageId: [
          {required: true, message: '产品图片不能为空', trigger: 'blur'}
        ],
        productDrawingId: [
          {required: true, message: '产品图纸不能为空', trigger: 'blur'}
        ],
        productCaliber: [
          {required: true, message: '口径不能为空', trigger: 'blur'},
          {
            validator: (rule, value, callback) => {
              if (/^[0-9]+\/[0-9]+$/.test(value)) {
                return callback()
              }
              return callback(new Error('口径格式应为[number]/[number]，比如20/20，分别对应内外口径'))
            },
            trigger: 'blur'
          }
        ],
        lengthWeightHeight: [
          {required: true, message: '长宽高不能为空', trigger: 'blur'}
        ],
        productQuestion: [
          {required: true, message: '产品问题不能为空', trigger: 'blur'}
        ],
        productAssort: [
          {required: true, message: '产品组合套不能为空', trigger: 'blur'}
        ],
        productTrailingProcess: [
          {required: true, message: '产品后续加工不能为空', trigger: 'blur'}
        ],
        productCategoryId: [
          {required: true, message: '产品分类不能为空', trigger: 'blur'}
        ],
        productOutNumber: [
          {required: true, message: '出库数量不能为空', trigger: 'blur'}
        ],
        outTime: [
          {required: true, message: '出库时间不能为空', trigger: 'blur'}
        ],
        orderImage: [
          {required: true, message: '图片留存不能为空', trigger: 'blur'}
        ],
        tickerNo: [
          {required: true, message: '出库单号不能为空', trigger: 'blur'}
        ],
        weightCount: [
          {required: true, message: '总克数不能为空', trigger: 'blur'}
        ],
        trayInfoId: [
          {required: true, message: '托盘id不能为空', trigger: 'blur'}
        ],
        groupNumber: [
          {required: true, message: '组数不能为空', trigger: 'blur'}
        ],
        isPriority: [
          {required: true, message: '优先级不能为空', trigger: 'blur'}
        ],
        zhiNumber: [
          {required: true, message: '只数不能为空', trigger: 'blur'}
        ],
        putInTime: [
          {required: true, message: '入库时间不能为空', trigger: 'blur'}
        ],
        supplierName: [
          {required: true, message: '供货商不能为空', trigger: 'blur'}
        ],
        paramKey: [
          {required: true, message: '参数名不能为空', trigger: 'blur'}
        ],
        paramValue: [
          {required: true, message: '参数值不能为空', trigger: 'blur'}
        ],
        roleName: [
          {required: true, message: '角色名称不能为空', trigger: 'blur'}
        ],
        userName: [
          {required: true, message: '用户名不能为空', trigger: 'blur'}
        ],
        userNo: [
          {required: true, message: '用工编号不能为空', trigger: 'blur'}
        ],
        createTime: [
          {required: true, message: '创建时间不能为空', trigger: 'blur'}
        ],
        trayOrderImage: [
          {required: true, message: '图片留存不能为空', trigger: 'blur'}
        ],
        trayOrderNo: [
          {required: true, message: '托盘订单编号不能为空', trigger: 'blur'}
        ],
        trayPrice: [
          {required: true, message: '纸箱价格不能为空', trigger: 'blur'}
        ],
        trayNo: [
          {required: true, message: '托盘编号不能为空', trigger: 'blur'}
        ],
        traySize: [
          {required: true, message: '拖盘规格不能为空', trigger: 'blur'}
        ],
        ticketNo: [
          {required: true, message: '票号不能为空', trigger: 'blur'}
        ],
        carNo: [
          {required: true, message: '车牌不能为空', trigger: 'blur'}
        ],
        intredientId: [
          {required: true, message: '材料id不能为空', trigger: 'blur'}
        ],
        intredientName: [
          {required: true, message: '材料名称不能为空', trigger: 'blur'}
        ],
        roughWeight: [
          {required: true, message: '毛重不能为空', trigger: 'blur'}
        ],
        suttleWeight: [
          {required: true, message: '净重不能为空', trigger: 'blur'}
        ],
        checkName: [
          {required: true, message: '验收人不能为空', trigger: 'blur'}
        ],
        company: [{required: true, message: '公司不能为空', trigger: 'blur'}],
        weightMan: [
          {required: true, message: '司磅人员不能为空', trigger: 'blur'}
        ],
        twoWeight: [
          {required: true, message: '二次过磅不能为空', trigger: 'blur'}
        ],
        agio: [
          {required: true, message: '扣水不能为空', trigger: 'blur'}
        ],
        driverName: [
          {required: true, message: '司机不能为空', trigger: 'blur'}
        ],
        vouchCode: [
          {required: true, message: '应收单号不能为空', trigger: 'blur'}
        ],
        vouchDate: [
          {required: true, message: '收款日期不能为空', trigger: 'blur'}
        ],
        vouchType: [
          {required: true, message: '款项类型(0-应收款;1-预收款;2-其他费用)，默认0不能为空', trigger: 'blur'}
        ],
        itemName: [
          {required: true, message: '用途，项目名称不能为空', trigger: 'blur'}
        ],
        payCode: [
          { required: true, message: '付款单编号不能为空', trigger: 'blur' }
        ],
        payDate: [
          { required: true, message: '付款日期不能为空', trigger: 'blur' }
        ],
        payInfo: [
          { required: true, message: '打款信息不能为空', trigger: 'blur' }
        ],
        customerName: [
          { required: true, message: '收款人名称不能为空', trigger: 'blur' }
        ],
        amount: [
          { required: true, message: '金额不能为空', trigger: 'blur' }
        ],
        category: [
          { required: true, message: '类别不能为空', trigger: 'blur' }
        ],
        sampleNo: [
          { required: true, message: '样品名称不能为空', trigger: 'blur' }
        ],
        sampleWeight: [
          { required: true, message: '样品克重不能为空', trigger: 'blur' }
        ],
        sampleDate: [
          { required: true, message: '打样时间不能为空', trigger: 'blur' }
        ],
        sysDictId: [
          { required: true, message: '信息不能为空', trigger: 'blur' }
        ],
        sysDictIdList: [
          { required: true, message: '信息不能为空', trigger: 'blur' }
        ],
        salesUserId:[
          { required: true, message: '业务人员不能为空', trigger: 'blur' }
        ],
        //deepProductImage
        deepProductImage: [
          { required: true, message: '深加工产品样图不能为空', trigger: 'blur' }
        ],
        purchaseNumber: [
          { required: true, message: '采购数量不能为空', trigger: 'blur' }
        ],
        contractTime: [
          { required: true, message: '合同时间不能为空', trigger: 'blur' }
        ],
        modelCategoryId:[
          { required: true, message: '模具类型不能为空', trigger: 'blur' }

        ],
        unitPrice: [
          { required: true, message: '价格', trigger: 'blur' }
        ],
        deepProductNo:[
          { required: true, message: '产品编号不能为空', trigger: 'blur' }
        ],
        deepProductId:[
          { required: true, message: '产品编号不能为空', trigger: 'blur' }
        ],
        bottleLength:[
          { required: true, message: '瓶子长度不能为空', trigger: 'blur' }
        ],
        bottleWeight:[
          { required: true, message: '瓶子宽度不能为空', trigger: 'blur' }
        ],
        createUser: [
          { required: true, message: '创建者不能为空', trigger: 'blur' }
        ],
        createDate: [
          { required: true, message: '创建时间不能为空', trigger: 'blur' }
        ],
        updateUser: [
          { required: true, message: '更新者不能为空', trigger: 'blur' }
        ],
        updateDate: [
          { required: true, message: '更新时间不能为空', trigger: 'blur' }
        ]
      }
    }
  },
  computed: {},
  methods: {
    /**
     * 获得需要的类型过滤器
     * @param names 需要的类型过滤器名称
     * @returns Array
     */
    getNeedDataRule(...names) {
      return this.R.pickAll(names, this.dataRuleList)
    },
    /**
     * 初始化纸箱信息列表
     * @param attrName 纸箱信息ID属性名
     */
    initBoxInfoIdList(attrName = 'boxInfoId') {
      mRequest('boxApi/getBoxNoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始化纸箱工厂列表
     * @param attrName 纸箱工厂ID属性名
     */
    initFactoryIdList(attrName = 'factoryId') {
      mRequest('boxApi/getBoxFactoryList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始化辅料信息列表
     * @param attrName 辅料ID属性名
     */
    initIngredientInfoList(attrName = 'ingredientInfoId') {
      mRequest('ingredientApi/getIngredientInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始化辅料类型列表
     * @param attrName 辅料类型ID属性名
     */
    initIngredientCategoryList(attrName = 'ingredientCategoryId') {
      mRequest('ingredientApi/getIngredientCategoryList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始化供应商列表
     * @param attrName 供应商ID属性名
     */
    initSupplierList(attrName = 'supplierId') {
      mRequest('supplierApi/getSupplierList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    initSupplierNoList(attrName = 'supplierId') {
      mRequest('supplierApi/getSupplierNoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始化配件列表
     * @param attrName 配件ID属性名
     */
    initPartInfoList(attrName = 'partInfoId') {
      mRequest('partApi/getPartInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始化配件类型列表
     * @param attrName 配件类型ID属性名
     */
    initPartCategoryList(attrName = 'partCategoryId') {
      mRequest('partApi/getPartCategoryList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始化托盘列表
     * @param attrName 配件信息ID属性名
     */
    initTrayList(attrName = 'trayInfoId') {
      mRequest('trayApi/getTrayInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始化仓库列表
     * @param attrName 仓库ID属性名
     */
    initWareHouseList(attrName = 'warehouseId') {
      mRequest('modelApi/getModelWarehouseList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'modelWarehouseList'], res) // TODO modelWarehouseList => list
      })
    },
    /**
     * 初始化货架列表
     * @param attrName 货架ID属性名
     */
    initShelfList(attrName = 'modelShelfId') {
      mRequest('modelApi/getModelShelfList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始化模具信息列表
     * @param attrName 模具ID属性名
     */
    initModelInfoList(attrName = 'modelInfoId') {
      mRequest('modelApi/getModelInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    //
    /**
     * 初始化模具出库信息列表
     * @param attrName 模具ID属性名
     */
    initModelOutList(attrName = 'modelOutId') {
      mRequest('modelApi/getModelOutList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始化用户信息列表
     * @param attrName 用户ID属性名
     */
    initUserInfoList(attrName = 'userId') {
      mRequest('userApi/getUserInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始化深加工种类列表
     * @param attrName 深加工种类ID属性名
     */
    initDeepCategoryList(attrName = 'deepCategoryList') {
      mRequest('deepApi/deepCategoryList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 集美 深加工中心 种类列表
     */
    initDeepCategoryListByJiMei(attrName = '') {
      mRequest('deepApi/getDeepCategoryListByJiMei', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },

    /**
     * 初始化产品种类列表
     * @param attrName 产品种类ID属性名
     */
    initProductCategoryList(attrName = 'productCategoryId') {
      mRequest('productApi/getProductCategoryList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始生产设备列表
     * @param attrName 生产设备ID属性名
     */
    initProductDeviceList(attrName = 'deviceId') {
      mRequest('productApi/getProductDeviceList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    initProductDeviceListByParent(attrName = 'deviceId') {
      mRequest('productApi/getProductDeviceListByParent', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始产品列表
     * @param attrName 产品ID属性名
     */
    initProductInfoList(attrName = 'productId') {
      mRequest('productApi/getProductInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    //productLeaveId
    initProductLeaveInfoList(attrName = 'productLeaveId') {
      mRequest('productApi/getProductLeaveList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },

    /**
     * 初始订单列表
     * @param attrName 订单ID属性名
     */
    initOrderDetailList(attrName = 'orderDetailId') {
      mRequest('orderApi/getOrderDetailList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始深加工订单列表
     * @param attrName 订单ID属性名
     */
    initDeepOrderDetailList(attrName = 'deepOrderDetailId') {
      mRequest('deepApi/deepOrderDetailList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始班别列表
     * @param attrName 班别ID属性名
     */
    initClassInfoList(attrName = 'classId') {
      mRequest('classesApi/getClassesInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始模具类型列表
     * @param attrName 模具类型ID属性名
     */
    initModelCategoryList(attrName = 'modelCategoryId') {
      mRequest('modelApi/getModelCategoryList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始化财务类型列表
     * @param attrName 财务类型ID属性名
     */
    initFinanceCategoryList(attrName = 'FinanceCategoryId') {
      mRequest('financeApi/getFinanceCategoryInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始客户名称类型列表
     * @param attrName 客户名称ID属性名
     */
    initClientInfoList(attrName = 'clientId') {
      mRequest('clientApi/getClientList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },

    /**
     * 初始产品批号列表
     * @param attrName 客户名称ID属性名
     */
    initProductBatchNoQueueList(attrName = 'productBachNoQueueId') {
      mRequest('productApi/getProductBatchNoQueueList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },


    /**
     * 初始客户名称类型列表
     * @param attrName 客户名称ID属性名
     */
    initSysRegionInfoList(attrName = 'sysRegionId') {
      mRequest('systemApi/getSysRegionList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 深加工产品信息
     */
    initDeepProductInfoList(attrName = 'deepProductId') {
      mRequest('deepApi/deepProductInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    initContractOrderInfoList(attrName = 'contractOrderId') {
      mRequest('contractApi/getContractOrderInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 获取所有人员信息
     */
    initSysUserInfoList(attrName = 'salesUserId') {
      mRequest('systemApi/listAllUser', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    initWarehouseInfoList(attrName = 'warehouseId') {
      mRequest('warehouseApi/getWarehouseInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    initContractPurchaseModelInfoList(attrName = 'contractPurchaseId') {
      mRequest('contractApi/getContractPurchaseInfoListByModel', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    initContractPurchasePartInfoList(attrName = 'contractPurchaseId') {
      mRequest('contractApi/getContractPurchaseInfoListByPart', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    initContractPurchaseInfoList(attrName = 'contractPurchaseId') {
      mRequest('contractApi/getContractPurchaseInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    //获取所有车辆信息
    initLicencePlateInfoList(attrName = 'licencePlateId') {
      mRequest('licenceApi/getLicencePlateInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    //获取商品信息
    //initCommodityInfoList
    initCommodityInfoList(attrName = 'commodityId') {
      mRequest('commodityApi/getCommodityInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    //获取盖子信息
    initBottleCapInfoList(attrName = 'bottleCapId') {
      mRequest('relateApi/getRelateBottleCapInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    //喷头
    initSprayHeadInfoList(attrName = 'bottleSprayHeadId') {
      mRequest('relateApi/getRelateSprayHeadInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    //肩套
    initNeckRingInfoList(attrName = 'neckRingId') {
      mRequest('relateApi/getRelateNeckRingInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    //中套
    initCenterCoverInfoList(attrName = 'centerCoverId') {
      mRequest('relateApi/getRelateCenterCoverInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    //getFinanceAccountInfoList
    initFinanceAccountInfoList(attrName = 'vouchAccount') {
      mRequest('financeApi/getFinanceAccountInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    initPurchaseProductInfoList(attrName = 'purchaseProductId') {
      mRequest('purchaseApi/getPurchaseProductInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },

    /**
     * 初始化 仓库
     * @param attrName
     */
    initPutInStorageLocationList(attrName = 'location'){
      mRequest('productApi/getPutInStorageLocationList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    /**
     * 初始化 客户类型
     * @param attrName
     */
    //clientType
    initOrderClientTypeList(attrName = 'clientType') {
      mRequest('orderApi/getOrderClientTypeList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
// 初始化 获取订单状态
    initTradeOrderStatusList(attrName = 'status') {
      mRequest('orderApi/getTradeOrderStatusList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },


    /**
     * 初始化 配件深加工
     */
    initRelateDeepCategoryList(attrName = 'relateDeepCategoryId') {
      mRequest('relateApi/getRelateDeepCategoryList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    },
    //getClientContractOrderInfoList
    initClientContractOrderOrderList(attrName = 'relateDeepCategoryId'){
      mRequest('contractApi/getClientContractOrderInfoList', {}, (res) => {
        this.dataFormConfig[attrName].list = this.R.pathOr([], ['data', 'list'], res)
      })
    }


  },
  filters: {},
  mounted() {
  },
  activated() {
  }
}
